<?php $this->start('menu') ?>
<?php echo $this->element('menu', array("str_menu" => $str_menu)); ?>
<?php $this->end() ?>
<?php if(!isset($_SESSION)){ 
  session_start();
} 
?>
<div id="right-panel">
    <?php if ($post) { ?>
        <h1 class="post-title"><?php echo $post['Post']['title'] ?></h1>
        <ul class="info-detail">
            <?php $date = date_create($post['Post']['created_at']); ?>
            <li class="date-info"><?php echo date_format($date, 'd/m/Y'); ?></li>
            <li>
                <a href="#comments" class="comment-info"><?php echo count($comments) ?> Bình luận</a>
            </li>
            <li>
                <a href="http://www.facebook.com/sharer.php?u=<?php echo Router::url($this->here, true); ?>&t=<?php echo $post['Post']['title'] ?>" 
                   target="_blank" class="facebook-info">Chia sẽ facebook</a>
            </li>
            <li>
                <a href="https://plus.google.com/share?url=<?php echo Router::url($this->here, true); ?>" target="_blank" class="google-info">Chia sẽ Google+</a>
            </li>
            <li>
                <a class="twitter-info" target="_blank"  href="http://twitter.com/share?text=<?php echo $post['Post']['title'] ?>&url=<?php echo Router::url($this->here, true); ?>">Chia sẽ Twitter</a>
            </li>
        </ul>
        <div style="float:right; margin-left:10px; display:none;"><?php echo $this->Posts->thumbBig($post) ?></div>
        <p class='pcontent' style="text-align:justify;">
            <?php echo $post['Post']['content'] ?>
        </p>

        <?php $this->start('meta') ?>
        <?php echo $this->Html->meta('keywords', $post['Post']['meta_keywords']); ?>
        <?php echo $this->Html->meta('description', $post['Post']['meta_description']); ?>
        <?php $this->end() ?>

        <div id="comments">
            <h3>Các lời bình luận (<?php echo count($comments) ?>)</h3>
            <?php echo $this->element('Comments/comments', array('comments' => $comments)); ?>
            <h3>Viết bình luận</h3>
            <div class="comment-form">
	              <?php $url = $this->Posts->getSEOLink($post); ?>
                <?php echo $this->Form->create('Comment', array('url' => $url)); ?>
		              <?php echo $this->Session->flash('bad'); ?>
		              <?php echo $this->Form->hidden('owner_id', array('value' => $post['Post']['id'])) ?>
		              <?php echo $this->Form->input('name', array('label' => __('Tên *'), 'class' => 'required', 'maxlength' => 50)) ?>
		              <?php echo $this->Form->input('email', array('label' => __('Email *'), 'class' => 'required email', 'maxlength' => 50)) ?>
		              <?php echo $this->Form->input('content', array('type' => 'textarea', 'label' => __('Nội dung *'), 'class' => 'required')) ?>
		              <div><?php echo __('Mã xác nhận *') ?></div> 
		              <?php echo $this->Captcha->show($captcha_image_url, isset($success_captcha) ? $success_captcha : '' , isset($error_captcha) ? $error_captcha : '' ); ?>
		              <?php echo $this->Form->hidden('callback', array('value' => $url)); ?>
		    				<?php echo $this->Form->end(array('label' => __('Gửi Bình Luận'), 'id' => 'submit_contact', 'style' => 'padding: 5px 10px; margin-top: 10px;', 'class' => 'submit')); ?>
            </div>
        </div>
<?php } ?>
</div> <!-- end #right-panel -->
<div id="left-panel">
<?php echo $this->element('Frontend/products_feature_vertical'); ?>
</div> <!-- end #left-panel -->				

<?php $this->start('script') ?>
<?php echo $this->Html->script('jquery.validate.min'); ?>
<?php echo $this->Html->script('messages_vi'); ?>
<script type="text/javascript">
    jQuery(document).ready(function(){
       jQuery('#CommentDisplayForm').validate();
    });
</script>
<?php $this->end() ?>
